<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <input id="unionaccountid" name="unionaccountid" type="hidden" th:value="${unionaccountid}">
                            <label class="col-sm-3 control-label">应用名称：</label>
                            <div class="col-sm-8">
                                <select id="relaid" name="relaid" class="form-control" type="text"></select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">广告位名称：</label>
                            <div class="col-sm-8">
                                <input maxlength="30" id="advpostitionname" name="advpostitionname" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">广告联盟广告位ID：</label>
                            <div class="col-sm-8">
                                <input maxlength="64" id="advpositionid" name="advpositionid"
                                       class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">广告位类型：</label>
                            <div class="col-sm-8">
                                <select id="advpositiontype" name="advpositiontype" class="form-control">
                                    <option value="1">banner</option>
                                    <option value="2">插屏</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">广告位描述：</label>
                            <div class="col-sm-8">
                                <input maxlength="30" id="advpositiondes" name="advpositiondes" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/appjs/market/thirdSdkAdvunionAdvpositionRelationship/add.js">
</script>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        $.ajax({
            type: 'get',
            url: '/market/thirdSdkAdvunionAdvpositionRelationship/listRelaIdthirdSdk?unionaccountid=' + $("#unionaccountid").val(),
            dataType: 'json',
            success: function (datas) {
                //返回list数据并循环获取
                var select = $("#relaid");
                for (var i = 0; i < datas.length; i++) {
                    select.append("<option value='" + datas[i].id + "'>"
                        + datas[i].thirdName + "</option>");
                }
            }
        });
    })
</script>
</body>
</html>
